package com.xuetang9.wordreview.config.contants;

/**
 * <p>Description:  常用常量类集合</p>
 * <p>CreateTime:   2020/5/12 </p>
 *
 * @author zhanweijie
 */
public class BasicConstants {

    /**
     * 管理员账号
     */
    public static final String ADMIN_USERNAME = "admin";

    public static final String TOKEN_KEY = "token";

    /**
     * 是否删除枚举
     */
    public enum Deleted {
        /**
         * 已经删除
         */
        T(1),
        /**
         * 未删除
         */
        F(0);

        public int value;

        Deleted(int value) {
            this.value = value;
        }
    }


    /**
     * 现成变量key
     */
    public enum ThreadVariableKey {
        //用户id
        ID,
        TOKEN
    }

    /**
     * 响应码
     */
    public enum HttpStatus {

        SUCCESS(200, "成功"),
        INTERNAL_SERVER_ERROR(500, "亲，服务器端出问题了呢!/(ㄒoㄒ)/~~"),
        PERMISSION_DENIED(401, "没有权限"),
        NOT_FOUND(404, "路径不存在，请检查路径是否正确"),
        TOKEN_INVALID(5001, "token失效，请重新登录"),
        USER_LOCKED(5002, "账号已被锁定,请联系管理员"),
        USER_NOT_FOUND(5003, "找不到改用户"),
        USERNAME_OR_PWD_ERR(5004, "用户名或密码错误"),
        USERNAME_DUPLICATE(5005, "用户名重复"),
        HAS_CHILDREN(5006, "请先删除子项再继续操作");


        public int code;
        public String msg;

        HttpStatus(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }
    }

    /**
     * 用户状态
     */
    public enum UserStatus {
        //正常
        NORMAL(0);

        public int value;

        UserStatus(int value) {
            this.value = value;
        }
    }


    /**
     * 菜单类型
     */
    public enum MenuType {
        //页面
        PAGE(1),
        //按钮
        BTN(2),
        //目录
        DIRECTORY(3);

        public int value;

        MenuType(int value) {
            this.value = value;
        }
    }


    /**
     * 菜单选中状态
     */
    public enum MenuCheckedStatus {
        HALF_CHECKED(1);

        public int value;

        MenuCheckedStatus(int value) {
            this.value = value;
        }
    }
}


